package com.linzh.commonbase.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class R<E> {
    private int code;
    private String msg;
    private E data;

    public static R success(){
        return new R(0, "操作成功",null);
    }
    public static<T> R<T> success(T data){
        return new R(0, "操作成功",data);
    }
    public static R error(String msg){
        return new R(1, msg!=null?msg:"操作失败",null);
    }
}
